package cake.srcprojector;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import cake.srcprojector.parser.IndexDocParser;
import cake.srcprojector.parser.InitDocParser;
import cake.srcprojector.parser.TOCDocParser;


/**
 * 
 * @author martin.vachon
 */
public class SrcProjector {

	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		File rootFile = new File(".");		
		
		try {
			DocParser initDocParser = new InitDocParser();
			
			DocTreeWalker docTreeWalker = new DocTreeWalker(initDocParser);
			docTreeWalker.start(rootFile);			
			
			
			DocParser tocDocParser = new TOCDocParser(new FileOutputStream(new File(rootFile, ".sp/toc.json")));
						
			docTreeWalker = new DocTreeWalker(tocDocParser);
			docTreeWalker.start(rootFile);
			
			DocParser indexDocParser = new IndexDocParser(new FileOutputStream(new File(rootFile, ".sp/index.json")));
			
			docTreeWalker = new DocTreeWalker(indexDocParser);
			docTreeWalker.start(rootFile);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}

}
